﻿using System.Collections.Generic;
using System.Linq;
using System.Web.Http;
using System.Web.Mvc;
using KL.UFrame.Core.Log;
using KL.UFrame.Core.Unity;
using KL.UFrame.Data.Business;

namespace KL.UFrame.Api.ApiControllers
{
    /// <summary>
    /// api for demo
    /// </summary>
    public class ValuesController : ApiController
    {
        private IValueBusiness _business;
        public ValuesController(IValueBusiness business)
        {
            _business = business;
        }
        
        /// <summary>
        /// test value
        /// </summary>
        /// <returns></returns>
        public bool Get()
        {
            return _business.Test();
        }

        // GET api/values/5
        public string Get(int id)
        {
            return _business.Get(id);
        }


        public string Get(int id,string value)
        {
             _business.Put(id,value);
            return "success";
        }

        // POST api/values
        public void Post([FromBody]string value)
        {
            
        }

        // PUT api/values/5
        public void Put(int id, [FromBody]string value)
        {
        }

        // DELETE api/values/5
        public void Delete(int id)
        {
        }
    }
}
